<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>

<h3 style="padding-left: 20px;padding-top: 10px">
	<?=$data['real_name']?>——关联资源
	<a href="?m=talent&c=manage&a=init&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>" style="font-size:14px;color: #0000FF"><em>返回上一级</em></a>
</h3>

<div class="subnav">
	<div class="content-menu ib-a blue line-x">
		<a href="?m=resource_asso&c=manage&a=moter_record&source_type=4&talent_id=<?=$id?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>"><em>履历</em></a>
		<span>|</span>
		<a href="?m=resource_asso&c=manage&a=init&source_type=1&talent_id=<?=$id?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>"><em>资讯</em></a>
		<span>|</span>
		<a href="?m=resource_asso&c=manage&a=init&source_type=2&talent_id=<?=$id?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>"> <em>视频</em></a>
		<span>|</span>
		<a href="?m=resource_asso&c=manage&a=init&source_type=3&talent_id=<?=$id?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>"><em>图片集</em></a>
		<span>|</span>
		<a href="./index.php?m=resource_asso&c=video&a=init&talent_id=<?=$id?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>" class="on"><em>视频集</em></a>


	</div>
</div>

<div class="pad-lr-10">

	<form name="searchform" action="" method="get">
		<input type="hidden" value="resource_asso" name="m">
		<input type="hidden" value="video" name="c">
		<input type="hidden" value="init" name="a">
		<input type="hidden" value="<?=$id?>" name="talent_id">
		<?php if(isset($_GET['id'])){?>
			<input type="hidden" value="<?=$_GET['id']?>" name="id">
		<?php }?>
		<table width="100%" cellspacing="0" class="search-form">
			<tbody>
			<tr>
				<td>
					<button type="button" style="float:right;margin-right:20px;margin-top:10px;" onclick="showAdd()" ><em>添加视频集</em></button>
					<span style="clear: both"></span>
					<script>
						function showAdd(){
							window.top.art.dialog({
									id: 'add',
									iframe: '?m=resource_asso&c=video&a=add&id=<?=$id?>',
									title: '添加视频集',
									width: '900',
									height: '500',
									lock: true
								},
								function() {
									var d = window.top.art.dialog({
										id: 'add'
									}).data.iframe;
									var form = d.document.getElementById('dosubmit');
									form.click();
									return false;
								},
								function() {
									window.top.art.dialog({
										id: 'add'
									}).close()
								});
						}

					</script>

					<div class="explain-col">

						视频集名称：
						<input name="keyword" type="text" value="<?php if(isset($_GET['keyword'])) {echo $_GET['keyword'];}?>"
							   class="input-text" />
						<input type="submit" name="search"  class="button" value="<?php echo L('search')?>" />
					</div>


				</td>
			</tr>
			</tbody>
		</table>
	</form>

	<form name="myform" action="?m=resource_asso&c=video&a=del" method="post"
		  onsubmit="return confirm('<?php echo L('confirm')?>')">
		<div class="table-list">
			<table width="100%" cellspacing="0">
				<thead>
				<tr>
					<th align="left" width="20"><input type="checkbox" value=""
													   id="check_box" onclick="selectall('id[]');"></th>
					<th align="left">ID</th>
					<th align="left"><?php echo "视频集名称"?></th>
					<th align="left"><?php echo "视频集描述"?></th>
					<th align="left"><?php echo "封面图"?></th>
					<th align="left"><?php echo "上次编辑者"?></th>
					<th align="left"><?php echo L('operation')?></th>
				</tr>
				</thead>
				<tbody>
				<?php
				if(!empty($contestinfo)){
					foreach ($contestinfo as $k => $v) {
						?>
						<tr>
							<td align="left"><input type="checkbox"
													value="<?php echo $v['id']?>" name="id[]"></td>
							<td align="left"><?php echo $v['id']?></td>
							<td align="left"><?php echo $v['name']?></td>
							<td align="left"><?php if(empty($v['description'])){echo "<font color='red'>未设置</font>";}else{echo str_cut($v['description'],20);}?></td>
							<td align="left"><?php if(!empty($r['image_cover'])){echo "<img src=".$r['image_cover']." height=60>";}else{echo "<font color='red'>未设置</font>";}?></td>
							<td align="left"><?php echo $adminInfo[$v['updated_by']]?></td>
							<td align="left">
	
								<a href="javascript:edit('<?php echo $v['id']?>', '<?php echo  new_addslashes(new_html_special_chars($v['name']))?>')"><?php echo L('edit')?></a> &nbsp;|&nbsp;
	
								<a href="?m=resource_asso&c=video&a=del&id=<?php echo $v['id']?>" onClick="return confirm('<?php echo L('confirm')?>')"><?php echo L('del')?></a>&nbsp;|&nbsp;
	
								<a href="?m=resource_asso&c=video&a=view&talent_id=<?=$id?>&id=<?php echo $v['id']?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>" >详情</a>
	
							</td>
						</tr>
						<?php
					}
				}else{
				?>
					<tr><td colspan='7' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>
				<?php }?>
				</tbody>
			</table>

			<div class="btn">
				<label for="check_box">
					<a href="#"
					   onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('select_all')?></a>/<a
						href="#"
						onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a></label>
				<input type="submit" class="button" name="dosubmit"
					   value="<?php echo L('delete')?>" />
			</div>

			<div id="pages"><?php echo $pages?></div>
		</div>
	</form>
</div>
<script type="text/javascript">

	function edit(id, name) {
		window.top.art.dialog({id:'edit'}).close();
		window.top.art.dialog({
				title: name,
				id: 'edit',
				iframe: '?m=resource_asso&c=video&a=edit&id=' + id,
				width: '900',
				height: '500'
			},
			function() {
				var d = window.top.art.dialog({
					id: 'edit'
				}).data.iframe;
				d.document.getElementById('dosubmit').click();
				return false;
			},
			function() {
				window.top.art.dialog({
					id: 'edit'
				}).close()
			});
	}

</script>
</body>
</html>